<h3>Gerenciar Projetos Finais</h3>

<p class="adicionar"><?php echo $html->link('Novo Projeto Final', array('action' => 'add')); ?></p>

<table border="1" cellspacing="0" cellpadding="0">
	<tr>
		<!--<th>Id</th>-->
		<th>Aluno</th>
		<th>Orientador</th>
		<th>Tema</th>
		<th>Semestre</th>
		<th>Resultado</th>
		<th>Arquivo</th>
		<!--<th>Tipo de Projeto</th>-->
		<th class="editar">Editar</th>
		<th class="excluir">Excluir</th>
	</tr>

	<?php foreach ($final_works as $f): ?>
	<tr>
		<!--<?php print_r ($final_works); ?>-->
		<!--<td><?php echo $f['FinalWork']['id']; ?></td>-->
      <td><?php echo $f['Student']['nome']; ?></td>
      <td><?php echo $f['Teacher']['nome']; ?></td>
      <td><?php echo $f['FinalWork']['tema']; ?></td>
      <td><?php echo $f['FinalWork']['ano_comeco'].'.'.$f['FinalWork']['semestre_comeco']; ?></td>
      <td><?php echo 'PF'.$f['FinalWork']['parte_projeto']; ?></td>
      <td>
		<?php 
			if ($f['FinalWork']['arquivo'] != "")
				echo $html->link('monografia', $f['FinalWork']['arquivo']); 
			else
				echo $f['FinalWork']['arquivo'];
		 ?>
		</td>
      <!--<td><?php //echo $f['FinalWork']['project']; ?></td>-->
		<td>
			<?php echo $html->link('Editar', '/final_works/edit/'.$f['FinalWork']['id'] );?>
		</td>
		<td>
			<?php echo $html->link('Excluir',  "/final_works/delete/{$f['FinalWork']['id']}", null, 'Deseja realmente excluir?' )?>
		</td>
	</tr>
	<?php endforeach; ?> 
</table>
